<template>

	<view>
		<bg-video></bg-video>
		<cu-custom bgColor="bg-main" :isBack="true">
			<block slot="content">门店详细</block>
		</cu-custom>
		<view class="flex justify-center text-xl bg-white  padding">
			<text>{{md.mdmc}}</text>
		</view>
		<!-- 轮播图 -->
		<view>
			<swiper class="screen-swiper" :indicator-dots="false" :circular="true" :autoplay="true" interval="2000"
				duration="500">
				<swiper-item v-for="(item,index) in md.imgs" :key="index">
					<image :src="item" mode="aspectFill"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="bg-white">
			<view class="padding text-lg">
				<text class="cuIcon-locationfill text-main"></text>
				<text class="margin-left-xs text-sm">
					<text>{{md.sheng}}</text>
					<text>{{md.shi}}</text>
					<text>{{md.qu}}</text>
					<text>{{md.address}}</text>
				</text>
			</view>

			<view class="padding text-xl">
				<text class="iconfont icon-jubaohuitubiao- text-main"></text>
				<text class="margin-left-xs text-sm">{{dz.dzmc ? dz.dzmc : "未设置"}}</text>
			</view>
			<view class="padding text-xl">
				<text class="iconfont icon-dianhua text-main"></text>
				<text class="margin-left-xs text-sm">{{dz.tel ? dz.tel : "未设置"}}</text>
			</view>
		</view>


		<!-- 房间信息开始 -->
		<view class="bg-white margin-top-sm">
			<view class="padding solid-bottom flex justify-start align-baseline">
				<view class="text-main title">
					<text class="text-xxl  ">
						<text class="iconfont icon-fangjian"></text>
					</text>
					<text>房间</text>
					<text class="">【{{fjs.length}}】</text>
				</view>
			</view>

			<!-- 房间列表 -->
			<view class="">
				<view class="padding-xs " v-for="(fj,index) in fjs" :key="index">
					<view class="bg-white shadow radius padding-xxs flex justify-between">
						<view class="w-25">
							<view class="relative w-100 radius overflow-hidden">
								<view class="img-cover relative">
								</view>
								<view class="absolute top0 w-100 h-100">
									<image class="w-100 h-100" mode="aspectFill" :src="fj.cover"></image>
								</view>
							</view>
							<view>
								
							</view>
						</view>
						<view class="w-75">
							<view class="padding-xs">
								<text>{{fj.fjmc}}</text>
							</view>
							<view class="padding-xs flex justify-between align-center">
								<text>{{fj.mj}}㎡</text>
								<uni-rate size="14"  :value="fj.rate"></uni-rate>
							</view>
							<view class="padding-xs flex justify-between align-center">
								<view>{{tp[fj.tp]}}</view>
								<view>{{func[fj.func]}}</view>
							</view>
							<view class="padding-xs flex justify-end align-center">
								<view><text @tap="toFjDetail(fj.fjid)" class="cu-tag bg-main radius">预约</text></view>
							</view>
							
						</view>
						
					</view>
				</view>
			</view>
		</view>
		<!-- 房间信息结束 -->

	</view>
</template>

<script>
	export default {
		data: function() {
			return {
				//门店信息
				md: {},
				dz: {},
				fjs: [],
				tp: {},
				func: {},
				locamap: {}
			}
		},
		created: function() {
			this.func = this.constant.roomfunc.ROOMFUNC;
			this.tp = this.constant.roomtp.ROOMTP;
		},
		onLoad: function(option) {
			this.md.mdid = option.mdid;
			this.getMd();
		},
		methods: {
			getMd: function() {
				this.api("/md/info/get").send({
					mdid: this.md.mdid
				}).then(data => {
					this.md = data.md;
					this.md.sheng = this.location.localmap.cmap[this.md.pcode].criname;
					this.md.shi = this.location.localmap.cmap[this.md.scode].criname;
					this.md.qu = this.location.localmap.cmap[this.md.qcode].criname;

					for (let index in data.fjs) {
						let record = data.fjs[index];
						this.fjs.push(record);

					}
					this.dz = data.adz;
				});
			},

			toFjDetail: function(id) {
				uni.navigateTo({
					url: `/pages/cmd/fj/detail?fjid=${id}` 
				})
			}
		}


	}
</script>

<style scoped>



</style>